﻿using System;
using System.Collections.Generic;
using System.Text;

using Weazel.Badger.Vhdl.Types;

namespace Weazel.Badger.Vhdl.Operators.Binary 
{
	public class Concatenation : BinaryFunction
	{
    private static BinaryTypeMap[] typeMaps = new BinaryTypeMap[]
      {
        new BinaryTypeMap(Types.Types.StdLogicVector, Types.Types.StdLogicVector, Types.Types.StdLogicVector),        
				new BinaryTypeMap(Types.Types.StdLogic, Types.Types.StdLogicVector, Types.Types.StdLogicVector),
				new BinaryTypeMap(Types.Types.StdLogicVector, Types.Types.StdLogic, Types.Types.StdLogicVector),
        new BinaryTypeMap(Types.Types.StdLogic, Types.Types.StdLogic, Types.Types.StdLogicVector),
      };

    public override BinaryTypeMap[] SignedTypeMaps
    {
      get
      {
        return typeMaps;
      }
    }

    public override BinaryTypeMap[] UnsignedTypeMaps
    {
      get
      {
        return typeMaps;
      }
    }

		public Concatenation()
    {
    }

    public override string ToString(string left, string right, int width)
    {
      return string.Format("{0} & {1}", left, right);
    }
	}
}
